package com.gooapple.notepad.util;

import android.app.Activity;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.gooapple.notepad.R;

public class UIManager {
	public static void showBasicBar(Activity activity, int sourceId,
			CharSequence topText, CharSequence bottomText, boolean showTopBar,
			boolean showBottomBar) {
		ImageView iconTopView = (ImageView) activity
				.findViewById(R.id.icon_top_image);
		TextView basicTopText = (TextView) activity
				.findViewById(R.id.basic_top_text);
		TextView basicBottomText = (TextView) activity
				.findViewById(R.id.basic_bottom_text);
		if (showTopBar) {
			if(sourceId != -1)
				iconTopView.setImageResource(sourceId);
			basicTopText.setText(topText);
		} else {
			iconTopView.setVisibility(View.GONE);
			basicTopText.setVisibility(View.GONE);
		}
		if (showBottomBar) {
			basicBottomText.setText(bottomText);
		} else {
			basicBottomText.setVisibility(View.GONE);
		}
	}

	public static void updateBasicBottomText(Activity activity, String text) {
		TextView basicBottomText = (TextView) activity
				.findViewById(R.id.basic_bottom_text);
		basicBottomText.setText(text);
	}
}
